//
//  SaveRusumeInfoAPIManger.m
//  FindJob
//
//  Created by apple on 16/3/14.
//  Copyright © 2016年 Lee. All rights reserved.
//

#import "SaveRusumeInfoAPIManger.h"
#import "NetWorkingConfig.h"
@implementation SaveRusumeInfoAPIManger
- (void)startSavePersonalInfoRequestWithParameters:(NSDictionary *)parameter respons:(void (^)(RespondsStatus, NSString *, id))respondsBlock{
    [self startRequestURL:kPersonalInfoURL parameters:parameter success:^(id responds) {
        NSInteger resultCode = [responds[@"resultCode"] integerValue];
        NSString *resultDesc = responds[@"resultDesc"];
        if (resultCode == 0) {
            if (respondsBlock) {
                respondsBlock(RespondsStatusSuccess,resultDesc,nil);
            }else{
                if (respondsBlock) {
                    respondsBlock(RespondsStatusDataError,resultDesc,nil);
                }
            }
        }
    } failure:^(NSError *error) {
        if (respondsBlock) {
            respondsBlock(RespondsStatusNotworkingError,@"网络错误",nil);
        }
    } timeout:20.f];
}
- (void)startSaveWorkExperienceRequestWithParameters:(NSDictionary *)parameter responds:(void (^)(RespondsStatus, NSString *))respondsBlock{
    [self startRequestURL:kWorkExperienceURL parameters:parameter success:^(id responds) {
        NSInteger resultCode = [responds[@"resultCode"] integerValue];
        NSString *resultDesc = responds[@"resultDesc"];
        if (resultCode == 0) {
            if (respondsBlock) {
                respondsBlock(RespondsStatusSuccess,resultDesc);
            }else{
                if (respondsBlock) {
                    respondsBlock(RespondsStatusDataError,resultDesc);
                }
            }
        }
    } failure:^(NSError *error) {
        if (respondsBlock) {
            respondsBlock(RespondsStatusNotworkingError,@"网络错误");
        }
    } timeout:20.f];
}
- (void)startSaveEducationExperienceRequestWithParameters:(NSDictionary *)parameter responds:(void (^)(RespondsStatus, NSString *))respondsBlock{
    [self startRequestURL:kEducationExperienceURL parameters:parameter success:^(id responds) {
        NSInteger resultCode = [responds[@"resultCode"] integerValue];
        NSString *resultDesc = responds[@"resultDesc"];
        if (resultCode == 0) {
            if (respondsBlock) {
                respondsBlock(RespondsStatusSuccess,resultDesc);
            }else{
                if (respondsBlock) {
                    respondsBlock(RespondsStatusDataError,resultDesc);
                }
            }
        }
    } failure:^(NSError *error) {
        if (respondsBlock) {
            respondsBlock(RespondsStatusNotworkingError,@"网络错误");
        }
    } timeout:20.f];
}
- (void)startSaveWorkTargetRequestWithParameters:(NSDictionary *)parameter responds:(void (^)(RespondsStatus, NSString *))respondsBlock{
    [self startRequestURL:kWorkTargetURL parameters:parameter success:^(id responds) {
        NSInteger resultCode = [responds[@"resultCode"] integerValue];
        NSString *resultDesc = responds[@"resultDesc"];
        if (resultCode == 0) {
            if (respondsBlock) {
                respondsBlock(RespondsStatusSuccess,resultDesc);
            }else{
                if (respondsBlock) {
                    respondsBlock(RespondsStatusDataError,resultDesc);
                }
            }
        }
    } failure:^(NSError *error) {
        if (respondsBlock) {
            respondsBlock(RespondsStatusNotworkingError,@"网络错误");
        }
    } timeout:30.f];
}
- (void)startSaveTrainExperienceRequestWithParameters:(NSDictionary *)parameter responds:(void (^)(RespondsStatus, NSString *))respondsBlock{
    [self startRequestURL:kTrainExperienceURL parameters:parameter success:^(id responds) {
        NSInteger resultCode = [responds[@"resultCode"] integerValue];
        NSString *resultDesc = responds[@"resultDesc"];
        if (resultCode == 0) {
            if (respondsBlock) {
                respondsBlock(RespondsStatusSuccess,resultDesc);
            }else{
                if (respondsBlock) {
                    respondsBlock(RespondsStatusDataError,resultDesc);
                }
            }
        }
    } failure:^(NSError *error) {
        if (respondsBlock) {
            respondsBlock(RespondsStatusNotworkingError,@"网络错误");
        }
    } timeout:30.f];
}
- (void)startSaveLanguageAbilityRequestWithParameters:(NSDictionary *)parameter responds:(void (^)(RespondsStatus, NSString *))respondsBlock{
    [self startRequestURL:kLanguageAbilityURL parameters:parameter success:^(id responds) {
        NSInteger resultCode = [responds[@"resultCode"] integerValue];
        NSString *resultDesc = responds[@"resultDesc"];
        if (resultCode == 0) {
            if (respondsBlock) {
                respondsBlock(RespondsStatusSuccess,resultDesc);
            }else{
                if (respondsBlock) {
                    respondsBlock(RespondsStatusDataError,resultDesc);
                }
            }
        }
    } failure:^(NSError *error) {
        if (respondsBlock) {
            respondsBlock(RespondsStatusNotworkingError,@"网络错误");
        }
    } timeout:30.f];
}
@end
